package blockchain.mystream;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

public abstract class MySocketAbstract {
    protected Socket socket;
    protected DataInputStream in;
    protected DataOutputStream out;

    protected MySocketAbstract() {}
    protected MySocketAbstract(Socket socket) throws IOException {
        this.socket = socket;
        this.in = new DataInputStream(socket.getInputStream());
        this.out = new DataOutputStream(socket.getOutputStream());
    }
    protected MySocketAbstract(Socket socket, DataInputStream in, DataOutputStream out) {
        this.socket = socket;
        this.in = in;
        this.out = out;
    }

    public abstract void close() throws IOException;
}
